home *** CD-ROM | disk | FTP | other *** search
/ How to Get Online 1996 Spring / HOW2GON.ISO / mac / Servers & CGI / CmmCGI / Documentation / HTML2_0.DOC Part 2 < prev   
Encoding:
Text File  |  1996-02-06  |  19.4 KB  |  580 lines  |  [ttro/ttxt]

  1. 5.7. Phrase Markup
  2.  
  3.    Phrases may be marked up according to idiomatic usage, typographic
  4.    appearance, or for use as hyperlink anchors.
  5.  
  6.    User agents must render highlighted phrases distinctly from plain
  7.    text. Additionally, <EM> content must be rendered as distinct from
  8.    <STRONG> content, and <B> content must rendered as distinct from <I>
  9.    content.
  10.  
  11.    Phrase elements may be nested within the content of other phrase
  12.    elements; however, HTML user agents may render nested phrase elements
  13.  
  14.    indistinctly from non-nested elements:
  15.  
  16.    plain <B>bold <I>italic</I></B> may be rendered
  17.    the same as plain <B>bold </B><I>italic</I>
  18.  
  19. 5.7.1. Idiomatic Elements
  20.  
  21.    Phrases may be marked up to indicate certain idioms.
  22.  
  23.       NOTE - User agents may support the <DFN> element, not included in
  24.       this specification, as it has been deployed to some extent. It is
  25.       used to indicate the defining instance of a term, and it is
  26.       typically rendered in italic or bold italic.
  27.  
  28. 5.7.1.1. Citation: CITE
  29.  
  30.       The <CITE> element is used to indicate the title of a book or
  31.       other citation. It is typically rendered as italics. For example:
  32.  
  33.       He just couldn't get enough of <cite>The Grapes of Wrath</cite>.
  34.  
  35. 5.7.1.2. Code: CODE
  36.  
  37.       The <CODE> element indicates an example of code, typically
  38.       rendered in a mono-spaced font. The <CODE> element is intended for
  39.       short words or phrases of code; the <PRE> block structuring
  40.       element (5.5.2, "Preformatted Text: PRE") is more appropriate
  41.        for multiple-line listings. For example:
  42.  
  43.       The expression <code>x += 1</code>
  44.       is short for <code>x = x + 1</code>.
  45.  
  46. 5.7.1.3. Emphasis: EM
  47.  
  48.       The <EM> element indicates an emphasized phrase, typically
  49.       rendered as italics. For example:
  50.  
  51.       A singular subject <em>always</em> takes a singular verb.
  52.  
  53. 5.7.1.4. Keyboard: KBD
  54.  
  55.       The <KBD> element indicates text typed by a user, typically
  56.       rendered in a mono-spaced font. This is commonly used in
  57.       instruction manuals. For example:
  58.  
  59.       Enter <kbd>FIND IT</kbd> to search the database.
  60.  
  61. 5.7.1.5. Sample: SAMP
  62.  
  63.       The <SAMP> element indicates a sequence of literal characters,
  64.       typically rendered in a mono-spaced font. For example:
  65.  
  66.       The only word containing the letters <samp>mt</samp> is dreamt.
  67.  
  68. 5.7.1.6. Strong Emphasis: STRONG
  69.  
  70.       The <STRONG> element indicates strong emphasis, typically rendered
  71.       in bold. For example:
  72.  
  73.       <strong>STOP</strong>, or I'll say "<strong>STOP</strong>" again!
  74.  
  75. 5.7.1.7. Variable: VAR
  76.  
  77.       The <VAR> element indicates a placeholder variable, typically
  78.       rendered as italic. For example:
  79.  
  80.       Type <SAMP>html-check <VAR>file</VAR> | more</SAMP>
  81.       to check <VAR>file</VAR> for markup errors.
  82.  
  83. 5.7.2. Typographic Elements
  84.  
  85.       Typographic elements are used to specify the format of marked
  86.       text.
  87.  
  88.       Typical renderings for idiomatic elements may vary between user
  89.       agents. If a specific rendering is necessary -- for example, when
  90.       referring to a specific text attribute as in "The italic parts are
  91.       mandatory" -- a typographic element can be used to ensure that the
  92.       intended typography is used where possible.
  93.  
  94.       NOTE - User agents may support some typographic elements not
  95.       included in this specification, as they have been deployed to some
  96.       extent. The <STRIKE> element indicates horizontal line through the
  97.       characters, and the <U> element indicates an underline.
  98.  
  99. 5.7.2.1. Bold: B
  100.  
  101.    The <B> element indicates bold text. Where bold typography is
  102.    unavailable, an alternative representation may be used.
  103.  
  104. 5.7.2.2. Italic: I
  105.  
  106.    The <I> element indicates italic text. Where italic typography is
  107.    unavailable, an alternative representation may be used.
  108.  
  109.  
  110. 5.7.2.3. Teletype: TT
  111.  
  112.    The <TT> element indicates teletype (monospaced )text. Where a
  113.    teletype font is unavailable, an alternative representation may be
  114.    used.
  115.  
  116. 5.7.3. Anchor: A
  117.  
  118.    The <A> element indicates a hyperlink anchor (see 7, "Hyperlinks").
  119.    At least one of the NAME and HREF attributes should be present.
  120.    Attributes of the <A> element:
  121.  
  122.     HREF
  123.             gives the URI of the head anchor of a hyperlink.
  124.  
  125.     NAME
  126.             gives the name of the anchor, and makes it available as
  127.             a head of a hyperlink.
  128.  
  129.     TITLE
  130.             suggests a title for the destination resource --
  131.             advisory only. The TITLE attribute may be used:
  132.  
  133.                 * for display prior to accessing the destination
  134.                 resource, for example, as a margin note or on a
  135.                 small box while the mouse is over the anchor, or
  136.                 while the document is being loaded;
  137.  
  138.                 * for resources that do not include a title, such as
  139.                 graphics, plain text and Gopher menus, for use as a
  140.                 window title.
  141.  
  142.     REL
  143.             The REL attribute gives the relationship(s) described by
  144.             the hyperlink. The value is a whitespace separated list
  145.             of relationship names. The semantics of link
  146.             relationships are not specified in this document.
  147.  
  148.     REV
  149.             same as the REL attribute, but the semantics of the
  150.             relationship are in the reverse direction. A link from A
  151.             to B with REL="X" expresses the same relationship as a
  152.             link from B to A with REV="X". An anchor may have both
  153.             REL and REV attributes.
  154.  
  155.     URN
  156.             specifies a preferred, more persistent identifier for
  157.             the head anchor of the hyperlink. The syntax and
  158.  
  159.             semantics of the URN attribute are not yet specified.
  160.  
  161.     METHODS
  162.             specifies methods to be used in accessing the
  163.             destination, as a whitespace-separated list of names.
  164.             The set of applicable names is a function of the scheme
  165.             of the URI in the HREF attribute. For similar reasons as
  166.             for the TITLE attribute, it may be useful to include the
  167.             information in advance in the link. For example, the
  168.             HTML user agent may chose a different rendering as a
  169.             function of the methods allowed; for example, something
  170.             that is searchable may get a different icon.
  171.  
  172. 5.8. Line Break: BR
  173.  
  174.    The <BR> element specifies a line break between words (see 6,
  175.    "Characters, Words, and Paragraphs"). For example:
  176.  
  177.     <P> Pease porridge hot<BR>
  178.     Pease porridge cold<BR>
  179.     Pease porridge in the pot<BR>
  180.     Nine days old.
  181.  
  182. 5.9. Horizontal Rule: HR
  183.  
  184.    The <HR> element is a divider between sections of text; typically a
  185.    full width horizontal rule or equivalent graphic.  For example:
  186.  
  187.     <HR>
  188.     <ADDRESS>February 8, 1995, CERN</ADDRESS>
  189.     </BODY>
  190.  
  191. 5.10. Image: IMG
  192.  
  193.    The <IMG> element refers to an image or icon via a hyperlink (see
  194.    7.3, "Simultaneous Presentation of Image Resources").
  195.  
  196.    HTML user agents may process the value of the ALT attribute as an
  197.    alternative to processing the image resource indicated by the SRC
  198.    attribute.
  199.  
  200.       NOTE - Some HTML user agents can process graphics linked via
  201.       anchors, but not <IMG> graphics. If a graphic is essential, it
  202.       should be referenced from an <A> element rather than an <IMG>
  203.       element. If the graphic is not essential, then the <IMG> element
  204.       is appropriate.
  205.  
  206.    Attributes of the <IMG> element:
  207.  
  208.     ALIGN
  209.             alignment of the image with respect to the text
  210.             baseline.
  211.  
  212.                 * `TOP' specifies that the top of the image aligns
  213.                 with the tallest item on the line containing the
  214.                 image.
  215.  
  216.                 * `MIDDLE' specifies that the center of the image
  217.                 aligns with the baseline of the line containing the
  218.                 image.
  219.  
  220.                 * `BOTTOM' specifies that the bottom of the image
  221.                 aligns with the baseline of the line containing the
  222.                 image.
  223.  
  224.     ALT
  225.             text to use in place of the referenced image resource,
  226.             for example due to processing constraints or user
  227.             preference.
  228.  
  229.     ISMAP
  230.             indicates an image map (see 7.6, "Image Maps").
  231.  
  232.     SRC
  233.             specifies the URI of the image resource.
  234.  
  235.                 NOTE - In practice, the media types of image
  236.                 resources are limited to a few raster graphic
  237.                 formats: typically `image/gif', `image/jpeg'. In
  238.                 particular, `text/html' resources are not
  239.                 intended to be used as image resources.
  240.  
  241.     Examples of use:
  242.  
  243.     <IMG SRC="triangle.xbm" ALT="Warning:"> Be sure
  244.     to read these instructions.
  245.  
  246.     <a href="http://machine/htbin/imagemap/sample">
  247.     <IMG SRC="sample.xbm" ISMAP>
  248.     </a>
  249.  
  250. 7. Hyperlinks
  251.  
  252.    In addition to general purpose elements such as paragraphs and lists,
  253.    HTML documents can express hyperlinks. An HTML user agent allows the
  254.    user to navigate these hyperlinks.
  255.  
  256.  
  257.    A hyperlink is a relationship between two anchors, called the head
  258.    and the tail of the hyperlink[DEXTER]. Anchors are identified by an
  259.    anchor address: an absolute Uniform Resource Identifier (URI),
  260.    optionally followed by a '#' and a sequence of characters called a
  261.    fragment identifier. For example:
  262.  
  263.    http://www.w3.org/hypertext/WWW/TheProject.html
  264.    http://www.w3.org/hypertext/WWW/TheProject.html#z31
  265.  
  266.    In an anchor address, the URI refers to a resource; it may be used in
  267.    a variety of information retrieval protocols to obtain an entity that
  268.    represents the resource, such as an HTML document. The fragment
  269.    identifier, if present, refers to some view on, or portion of the
  270.    resource.
  271.  
  272.    Each of the following markup constructs indicates the tail anchor of
  273.    a hyperlink or set of hyperlinks:
  274.  
  275.         * <A> elements with HREF present.
  276.  
  277.         * <LINK> elements.
  278.  
  279.         * <IMG> elements.
  280.  
  281.         * <INPUT> elements with the SRC attribute present.
  282.  
  283.         * <ISINDEX> elements.
  284.  
  285.         * <FORM> elements with `METHOD=GET'.
  286.  
  287.    These markup constructs refer to head anchors by a URI, either
  288.    absolute or relative, or a fragment identifier, or both.
  289.  
  290.    In the case of a relative URI, the absolute URI in the address of the
  291.    head anchor is the result of combining the relative URI with a base
  292.    absolute URI as in [RELURL]. The base document is taken from the
  293.    document's <BASE> element, if present; else, it is determined as in
  294.    [RELURL].
  295.  
  296. 8. Forms
  297.  
  298.    A form is a template for a form data set and an associated
  299.    method and action URI. A form data set is a sequence of
  300.    name/value pair fields. The names are specified on the NAME
  301.    attributes of form input elements, and the values are given
  302.    initial values by various forms of markup and edited by the
  303.    user. The resulting form data set is used to access an
  304.    information service as a function of the action and method.
  305.  
  306.    Forms elements can be mixed in with document structuring
  307.    elements. For example, a <PRE> element may contain a <FORM>
  308.    element, or a <FORM> element may contain lists which contain
  309.    <INPUT> elements. This gives considerable flexibility in
  310.    designing the layout of forms.
  311.  
  312.    Form processing is a level 2 feature.
  313.  
  314. 8.1. Form Elements
  315.  
  316. 8.1.1. Form: FORM
  317.  
  318.    The <FORM> element contains a sequence of input elements, along
  319.    with document structuring elements. The attributes are:
  320.  
  321.     ACTION
  322.             specifies the action URI for the form. The action URI of
  323.             a form defaults to the base URI of the document (see 7,
  324.             "Hyperlinks").
  325.  
  326.     METHOD
  327.             selects a method of accessing the action URI. The set of
  328.             applicable methods is a function of the scheme of the
  329.             action URI of the form. See 8.2.2, "Query Forms:
  330.             METHOD=GET" and 8.2.3, "Forms with Side-Effects:
  331.             METHOD=POST".
  332.  
  333.     ENCTYPE
  334.             specifies the media type used to encode the name/value
  335.             pairs for transport, in case the protocol does not
  336.             itself impose a format. See 8.2.1, "The form-urlencoded
  337.             Media Type".
  338.  
  339. 8.1.2. Input Field: INPUT
  340.  
  341.    The <INPUT> element represents a field for user input. The TYPE
  342.    attribute discriminates between several variations of fields.
  343.  
  344.  
  345.    The <INPUT> element has a number of attributes. The set of applicable
  346.    attributes depends on the value of the TYPE attribute.
  347.  
  348. 8.1.2.1. Text Field: INPUT TYPE=TEXT
  349.  
  350.    The default value of the TYPE attribute is `TEXT', indicating a
  351.    single line text entry field. (Use the <TEXTAREA> element for multi-
  352.    line text fields.)
  353.  
  354.    Required attributes are:
  355.  
  356.     NAME
  357.             name for the form field corresponding to this element.
  358.  
  359.     The optional attributes are:
  360.  
  361.     MAXLENGTH
  362.             constrains the number of characters that can be entered
  363.             into a text input field. If the value of MAXLENGTH is
  364.             greater the the value of the SIZE attribute, the field
  365.             should scroll appropriately. The default number of
  366.             characters is unlimited.
  367.  
  368.     SIZE
  369.             specifies the amount of display space allocated to this
  370.             input field according to its type. The default depends
  371.             on the user agent.
  372.  
  373.     VALUE
  374.             The initial value of the field.
  375.  
  376.     For example:
  377.  
  378. <p>Street Address: <input name=street><br>
  379. Postal City code: <input name=city size=16 maxlength=16><br>
  380. Zip Code: <input name=zip size=10 maxlength=10 value="99999-9999"><br>
  381.  
  382. 8.1.2.2. Password Field: INPUT TYPE=PASSWORD
  383.  
  384.    An <INPUT> element with `TYPE=PASSWORD' is a text field as above,
  385.    except that the value is obscured as it is entered. (see also: 10,
  386.    "Security Considerations").
  387.  
  388.    For example:
  389.  
  390. <p>Name: <input name=login> Password: <input type=password name=passwd>
  391.  
  392.  
  393.  
  394. 8.1.2.3. Check Box: INPUT TYPE=CHECKBOX
  395.  
  396.    An <INPUT> element with `TYPE=CHECKBOX' represents a boolean choice.
  397.    A set of such elements with the same name represents an n-of-many
  398.    choice field. Required attributes are:
  399.  
  400.     NAME
  401.             symbolic name for the form field corresponding to this
  402.             element or group of elements.
  403.  
  404.     VALUE
  405.             The portion of the value of the field contributed by
  406.             this element.
  407.  
  408.     Optional attributes are:
  409.  
  410.     CHECKED
  411.             indicates that the initial state is on.
  412.  
  413.     For example:
  414.  
  415.   <p>What flavors do you like?
  416.   <input type=checkbox name=flavor value=vanilla>Vanilla<br>
  417.   <input type=checkbox name=flavor value=strawberry>Strawberry<br>
  418.   <input type=checkbox name=flavor value=chocolate checked>Chocolate<br>
  419.  
  420. 8.1.2.4. Radio Button: INPUT TYPE=RADIO
  421.  
  422.    An <INPUT> element with `TYPE=RADIO' represents a boolean choice. A
  423.    set of such elements with the same name represents a 1-of-many choice
  424.    field. The NAME and VALUE attributes are required as for check boxes.
  425.    Optional attributes are:
  426.  
  427.     CHECKED
  428.             indicates that the initial state is on.
  429.    At all times, exactly one of the radio buttons in a set is checked.
  430.    If none of the <INPUT> elements of a set of radio buttons specifies
  431.    `CHECKED', then the user agent must check the first radio button of
  432.    the set initially.
  433.  
  434.    For example:
  435.  
  436.     <p>Which is your favorite?
  437.     <input type=radio name=flavor value=vanilla>Vanilla<br>
  438.     <input type=radio name=flavor value=strawberry>Strawberry<br>
  439.     <input type=radio name=flavor value=chocolate>Chocolate<br>
  440.  
  441.  
  442.  
  443. 8.1.2.5. Image Pixel: INPUT TYPE=IMAGE
  444.  
  445.    An <INPUT> element with `TYPE=IMAGE' specifies an image resource to
  446.    display, and allows input of two form fields: the x and y coordinate
  447.    of a pixel chosen from the image. The names of the fields are the
  448.    name of the field with `.x' and `.y' appended.  `TYPE=IMAGE' implies
  449.    `TYPE=SUBMIT' processing; that is, when a pixel is chosen, the form
  450.    as a whole is submitted.
  451.  
  452.    The NAME attribute is required as for other input fields. The SRC
  453.    attribute is required and the ALIGN is optional as for the <IMG>
  454.    element (see 5.10, "Image: IMG").
  455.  
  456.    For example:
  457.  
  458.     <p>Choose a point on the map:
  459.     <input type=image name=point src="map.gif">
  460.  
  461. 8.1.2.6. Hidden Field: INPUT TYPE=HIDDEN
  462.  
  463.    An <INPUT> element with `TYPE=HIDDEN' represents a hidden field.The
  464.    user does not interact with this field; instead, the VALUE attribute
  465.    specifies the value of the field. The NAME and VALUE attributes are
  466.    required.
  467.  
  468.    For example:
  469.  
  470.    <input type=hidden name=context value="l2k3j4l2k3j4l2k3j4lk23">
  471.  
  472. 8.1.2.7. Submit Button: INPUT TYPE=SUBMIT
  473.  
  474.    An <INPUT> element with `TYPE=SUBMIT' represents an input option,
  475.    typically a button, that instructs the user agent to submit the form.
  476.    Optional attributes are:
  477.  
  478.     NAME
  479.             indicates that this element contributes a form field
  480.             whose value is given by the VALUE attribute. If the NAME
  481.             attribute is not present, this element does not
  482.             contribute a form field.
  483.  
  484.     VALUE
  485.             indicates a label for the input (button).
  486.  
  487.     You may submit this request internally:
  488.     <input type=submit name=recipient value=internal><br>
  489.     or to the external world:
  490.     <input type=submit name=recipient value=world>
  491.  
  492. 8.1.2.8. Reset Button: INPUT TYPE=RESET
  493.  
  494.    An <INPUT> element with `TYPE=RESET' represents an input option,
  495.    typically a button, that instructs the user agent to reset the form's
  496.    fields to their initial states. The VALUE attribute, if present,
  497.    indicates a label for the input (button).
  498.  
  499.    When you are finished, you may submit this request:
  500.    <input type=submit><br>
  501.    You may clear the form and start over at any time: <input type=reset>
  502.  
  503. 8.1.3. Selection: SELECT
  504.  
  505.    The <SELECT> element constrains the form field to an enumerated list
  506.    of values. The values are given in <OPTION> elements.  Attributes
  507.    are:
  508.  
  509.     MULTIPLE
  510.             indicates that more than one option may be included in
  511.             the value.
  512.  
  513.     NAME
  514.             specifies the name of the form field.
  515.  
  516.     SIZE
  517.             specifies the number of visible items. Select fields of
  518.             size one are typically pop-down menus, whereas select
  519.             fields with size greater than one are typically lists.
  520.  
  521.     For example:
  522.  
  523.     <SELECT NAME="flavor">
  524.     <OPTION>Vanilla
  525.     <OPTION>Strawberry
  526.     <OPTION value="RumRasin">Rum and Raisin
  527.     <OPTION selected>Peach and Orange
  528.     </SELECT>
  529.  
  530.    The initial state has the first option selected, unless a SELECTED
  531.    attribute is present on any of the <OPTION> elements.
  532.  
  533. 8.1.3.1. Option: OPTION
  534.  
  535.    The Option element can only occur within a Select element. It
  536.    represents one choice, and has the following attributes:
  537.  
  538.     SELECTED
  539.             Indicates that this option is initially selected.
  540.  
  541.     VALUE
  542.             indicates the value to be returned if this option is
  543.             chosen. The field value defaults to the content of the
  544.             <OPTION> element.
  545.  
  546.    The content of the <OPTION> element is presented to the user to
  547.    represent the option. It is used as a returned value if the VALUE
  548.    attribute is not present.
  549.  
  550. 8.1.4. Text Area: TEXTAREA
  551.  
  552.    The <TEXTAREA> element represents a multi-line text field.
  553.    Attributes are:
  554.  
  555.     COLS
  556.             the number of visible columns to display for the text
  557.             area, in characters.
  558.  
  559.     NAME
  560.             Specifies the name of the form field.
  561.  
  562.     ROWS
  563.             The number of visible rows to display for the text area,
  564.             in characters.
  565.  
  566.     For example:
  567.  
  568.     <TEXTAREA NAME="address" ROWS=6 COLS=64>
  569.     HaL Computer Systems
  570.     1315 Dell Avenue
  571.     Campbell, California 95008
  572.     </TEXTAREA>
  573.  
  574.    The content of the <TEXTAREA> element is the field's initial value.
  575.  
  576.    Typically, the ROWS and COLS attributes determine the visible
  577.    dimension of the field in characters. The field is typically rendered
  578.    in a fixed-width font. HTML user agents should allow text to extend
  579.    beyond these limits by scrolling as needed.
  580.